/*******************************************************************************
 * Copyright (c) 2002 Boris Pruessmann and others.
 * All rights reserved.   This program and the accompanying materials
 * are made available under the terms of the Common Public License v0.5
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/cpl-v05.html
 * 
 * Contributors:
 *    Boris Pruessmann - Initial implementation.
 ******************************************************************************/
package net.sourceforge.perforce.core.internal.api;

/**
  * @version $Revision: 225 $
  * @author  <a href="mailto:bpruessmann@users.sourceforge.net">Boris Pruessmann</a>
  */
public class ChangeSpec 
{
	// --------------------------------------------------------------------------- Private Variables
	
	/** Stores the Perforce spec string. */
	private String specString;
	/** Stores the affected files. */
	private String[] files; 
	
	// ------------------------------------------------------------------------- Public Constructors
	
	/** Constructor for ChangeSpec. 
	  * 
	  * @param theServer the perforce server.
	  * @param theSpecString the Perforce spec string.
	  * @param theFileCount number of affected files.
	  */
	public ChangeSpec(String theSpecString, String[] theFiles)
	{
		specString = theSpecString;
		files = theFiles;
	}
	
	// ------------------------------------------------------------------------------ Public Methods
		
	/** Returns the number of affected files.
	  *
	  * @return the file count. 
	  */
	public int getFileCount()
	{
		return files.length;
	}
	
	/** Returns an array of affected files (depot syntax)
	  *
	  * @return affected files 
	  */
	public String[] getFiles()
	{
		return files;
	}
	
	/** @see java.lang.Object#toString() */
	public String toString() 
	{
		return specString;
	}
}
